package top.kaoshanji.p2ch10b;

import java.io.Serializable;

/**
 * 代码清单-p2ch10b-330页a：替换对象的Java类
 * author kaoshanji
 * ^_^
 * create time 2025/2/3 11:35
 */
public class OrderTO implements Serializable {

    private String orderId;

    public OrderTO(Order order) {
        this.orderId = order.getId();
    }

    private Object readResolve() {
        return OrderGateway.getOrder(orderId);
    }

}
